package tag17_01_08.conteiner;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class Thema3_TestJPanels {

	public static void main(String[] args) {
		
		
		JFrame frame = new JFrame();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setBounds(100, 200, 600, 150);

		//BorderLayout
		JPanel mainPanel = (JPanel)frame.getContentPane();
				
		//WEST
		JPanel panelWest = new JPanel();
		mainPanel.add(panelWest, BorderLayout.WEST);
		
		for (int i = 0; i < 5; i++) {
			panelWest.add( new JLabel("Label " + i) );
		}
		
		panelWest.setBackground(Color.ORANGE);
		
		//ZENTRUM
		JPanel panelCenter = new JPanel();
		panelCenter.setLayout(new BorderLayout());
		
		JTextArea textArea = new JTextArea();
		panelCenter.add(textArea);
		
		mainPanel.add(panelCenter);
		
		frame.setVisible(true);
		
		//-----------------------------------------------------
		JPanel panelWrapperTextField = new JPanel();
		panelWrapperTextField.setLayout(new BorderLayout());
		JTextField textField = new JTextField();
		textField.setMinimumSize( new Dimension(100, 25) );
		textField.setPreferredSize( new Dimension(100, 25) );
		panelWrapperTextField.add(textField, BorderLayout.WEST);
		
		mainPanel.add(panelWrapperTextField, BorderLayout.SOUTH);
		
	}

}
